#ifndef RESOURCE_H_
#define RESOURCE_H_

#include <string>

#include "Object.h"

namespace OOInterface {

class Resource: public Object
{
public:
	Resource( std::string name, std::string type ) : _name(name), _type(type) {}
	Resource( const Resource& r ) : _name(r._name), _type( r._type ) {}
	virtual ~Resource() { }

	Resource& operator=( const Resource& rhs )
	{
		_name = rhs._name; _type = rhs._type;
		return *this;
	}

	inline const std::string& getType() const { return _type; }
	inline const std::string& getName() const { return _name; }

	inline void setType( std::string type ) { _type = type; }
	inline void setName( std::string name ) { _name = name; }

	inline bool operator!=( const Resource& r ) const { return _type.compare(r._type) != 0 || _name.compare(r._name) != 0; }
	inline bool operator==( const Resource& r ) const { return _type.compare(r._type) == 0 && _name.compare(r._name) == 0; }

	inline bool operator<( const Resource& r ) const { return _type.compare(r._type) < 0 && _name.compare(r._name) < 0; }

	virtual std::string toString() const { return _name; }

private:
	std::string _name;
	std::string _type;
};

}

#endif /*RESOURCE_H_*/
